# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=cdogs-sdl
pkgver=1.2.0
pkgrel=1
pkgdesc="Classic overhead run-and-gun game"
url="https://cxong.github.io/cdogs-sdl/"
arch="all"
license="GPL-1.0-only"
makedepends="cmake sdl2_image-dev sdl2-dev sdl2_mixer-dev mesa-dev gtk+3.0-dev"
options="!check" #make check not implemented
source="$pkgname-$pkgver.tar.gz::https://github.com/cxong/cdogs-sdl/archive/$pkgver.tar.gz"

# Fix build with recent GCC
export CFLAGS="$CFLAGS -Wno-error=inline -fcommon"

build() {
	cmake CMakeLists.txt \
		-DCMAKE_INSTALL_PREFIX=/usr/share/cdogs-sdl \
		-DCDOGS_DATA_DIR=/usr/share/cdogs-sdl/ \
		-DCMAKE_BUILD_TYPE=None
	make
}

package() {
	make DESTDIR="$pkgdir" install
	mv "$pkgdir"/usr/share/cdogs-sdl/bin/ "$pkgdir"/usr/bin/
	mv "$pkgdir"/usr/share/cdogs-sdl/share/* "$pkgdir"/usr/share/
}

sha512sums="70a5a4bb8e48cf53a4497807b14d8a70e26ad6b74f0c4675b3d98667c867d499d372f323e7abb669ebef08b1d6b5ac9c840ab14eada38e7b868d3099ed6b3e35  cdogs-sdl-1.2.0.tar.gz"
